import http from "../../utils/http";
export const getEmailCode = data => {
  return http({
    url: "pub/mailCheck",
    method: "post",
    data
  });
};
export const getSmsCode = data => {
  return http({
    url: "pub/sms",
    method: "post",
    data
  });
};
export const getTeacherSmsCode = data => {
  return http({
    url: "pub/smsV2",
    method: "post",
    data
  });
};
//忘记密码获取验证码
export const getVerifyCode = data => {
  return http({
    url: "/pub/getVerifyCode",
    method: "post",
    data
  });
};
//忘记密码修改密码
export const updateUserPwd = data => {
  return http({
    url: "/pub/verifyCodeUpdatePwd",
    method: "post",
    data
  });
};
export const userRegist = data => {
  return http({
    url: "pub/resgist",
    method: "post",
    data
  });
};
export const userLogin = data => {
  return http({
    url: "pub/login",
    method: "post",
    data
  });
};
export const userLogout = data => {
  return http({
    url: "pub/logout",
    method: "post",
    data
  });
};
export const getUserInfo = id => {
  return http({
    url: "user/selectOne?id=" + id,
    method: "get"
  });
};
export const userInfoUpdate = data => {
  return http({
    url: "client/user/update-user",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data;charset=UTF-8"
    },
    data
  });
};
export const uploadAvatar = data => {
  return http({
    url: "user/upload-avatar",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data;charset=UTF-8"
    },
    data
  });
};

export const wxLogin = type => {
  return http({
    url: "wx/wxauthorizeurl?type=" + type,
    method: "get"
  });
};
export const wxQrLogin = type => {
  return http({
    url: "wx/qrcode?type=" + type,
    method: "get"
  });
};

export const getTeacher = params => {
  return http({
    url: "client/teacher/selectOne",
    method: "get",
    params
  });
};

export const updatePass = params => {
  return http({
    url: "client/forgot/password",
    method: "get",
    params
  });
};

export const resetPass = data => {
  return http({
    url: "client/reset/password",
    method: "post",
    data
  });
};

export const unbindWechat = data => {
  return http({
    url: "user/unbinding",
    method: "post",
    data
  });
};
export const getGradeSchoolList = () => {
  return http({
    url: "grade/getGradeSchoolList",
    method: "get"
  });
};
export const updateGradeSchoolInfo = data => {
  return http({
    url: "user/replenishInfo",
    method: "post",
    data
  });
};